package pro.softzhang.algo.lc1200;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

public class LC1207_UniqueNumberOfOccurrences {
    public static void main(String[] args) {

    }

    static
    class Solution {
        public boolean uniqueOccurrences(int[] arr) {
            Map<Integer, Integer> occurrence = new HashMap<>((int)(arr.length / 0.75 + 1));
            for(int i : arr) {
                occurrence.put(i, occurrence.getOrDefault(i, 0) + 1);
            }
            return occurrence.size() == new HashSet<>(occurrence.values()).size();
        }
    }
}
